<script src="<?php echo base_url('public/js/bootstrap-modal.js');?>"></script>
<script>
$(function(){
    //導覽列指定-blog
   $("#menu ul > li[class='blog']").attr("class","current_page_item");

    //   
   $('#myModal').modal(options);
});
</script>
<style>
#func{
  float:right;
}
#logo {
  padding: 30px 0px 10px;
}
textarea{
  width: 400px;
  height: 150px;
}
</style>

<!-- 關於我 -->
<div class="modal hide fade in" id="myModal">
  <div class="modal-header">
    <button class="close" data-dismiss="modal">×</button>
    <h3>編輯 關於我</h3>
  </div>  
  
  <form method="post" action="<?php echo site_url('frontend/blog/about_me');?>">
  <div class="modal-body">    
       <label>內容：</label>
       <textarea name="memo"><?php echo $memo;?></textarea>
  </div>
  <div class="modal-footer"> 
    <input type="hidden" name="login" value="<?php echo $login;?>" />
    <a href="#" class="btn" data-dismiss="modal">關閉</a>
    <input class="btn btn-primary" type="submit" value="儲存"/>
  </div>
   </form>
</div>


<!-- 文章分類 -->
<div class="modal hide fade in" id="myModal2">
  <div class="modal-header">
    <button class="close" data-dismiss="modal">×</button>
    <h3>新增 文章分類</h3>
  </div>  
  
  <?php echo form_open('frontend/blog/category_add');?>
  
  <form method="post" action="<?php echo site_url('frontend/blog/category_add');?>">
  <div class="modal-body"> 
       <label>日期：</label><input type="text" name="cdate" value="<?php echo date("y/m/d h:i:s");?>" />   
       <label>分類：</label><input type="text" name="category" />
  </div>                                                      
  <div class="modal-footer"> 
    <input type="hidden" name="cuser" value="<?php echo $login;?>" />
    <a href="#" class="btn" data-dismiss="modal">關閉</a>
    <input class="btn btn-primary" type="submit" value="儲存"/>
  </div>
   </form>
</div>

<!-- blog 導覽列 -->
<div id="header-wrapper">
	<div id="header">
		<div id="logo">		
		<h1><a href="#">我的 <span>blog</span></a>		
		    <a class="btn" data-toggle="modal" href="#myModal" style="font-size:18px;float:right"><b><span>關於我</span></b></a>
		    <a class="btn" href="<?php echo site_url('frontend/blog/add');?>" style="font-size:18px;float:right;margin-right:25px"><b><span>張貼文章</span></b></a>	
		    <a class="btn" data-toggle="modal" href="#myModal2" style="font-size:18px;float:right;margin-right:40px"><b><span>新增分類</span></b></a>		   	   
		</h1>	
		</div>
    <hr/>		
	</div>	
</div>
<p>


<div id="wrapper">
	<!-- end #header -->
	<div id="page">
		<div id="page-bgtop">
			<div id="page-bgbtm">
				<div id="content">
				
				<div>blog <?php echo isset($_GET['category_id']) ? '>'.$_GET['category_id'] : '';?> </div>
				
				   <?php foreach ($data['article'] as $row):?>
					<div class="post">
						<h2 class="title"><a href="#"><?php echo $row['title'];?></a></h2>
						<p class="meta"><span class="date"><?php echo $row['cdate'];?></span><span class="posted">Posted by <a href="#"><?php echo $row['cuser'];?></a></span></p>
						<div style="clear: both;">&nbsp;</div>
						<div class="entry">
							<?php echo $row['content'];?>
							<p class="links"><a href="#">Read More</a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">Comments</a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo site_url("frontend/blog/edit/{$row['id']}");?>">編輯</a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">刪除</a></p>
						</div>
					</div>
						<?php endforeach;?>					
					<div style="clear: both;">&nbsp;</div>
				</div>
				<!-- end #content -->
				<div id="sidebar">
					<ul>
						<li>
							<h2>搜尋 :</h2>
							<div id="search" >
								<form method="get" action="#">
									<div>
										<input type="text" name="s" id="search-text" value="" />
										<input type="submit" id="search-submit" value="" />
									</div>
								</form>
							</div>
							<div style="clear: both;">&nbsp;</div>
						</li>
						<li>
							<h2>關於我 :</h2>
							<p><?php echo $memo;?></p>
						</li>
						<li>
							<h2>分類 :</h2>							
							   <ul>
							      <?php foreach ($data['category'] as $row):?>
								    <li><a href="<?php echo site_url("frontend/blog?category_id={$row['category']}");?>"><?php echo $row['category'];?></a></li>
							      <?php endforeach;?>								
							   </ul>							
						</li>
						<li>
							<h2>連結 :</h2>
							<ul>
								<li><a href="#">Aliquam libero</a></li>
								<li><a href="#">Consectetuer adipiscing elit</a></li>
								<li><a href="#">Metus aliquam pellentesque</a></li>
								<li><a href="#">Suspendisse iaculis mauris</a></li>
								<li><a href="#">Urnanet non molestie semper</a></li>
								<li><a href="#">Proin gravida orci porttitor</a></li>
							</ul>
						</li>
						<li>
							<h2>檔案 :</h2>
							<ul>
								<li><a href="#">Aliquam libero</a></li>
								<li><a href="#">Consectetuer adipiscing elit</a></li>
								<li><a href="#">Metus aliquam pellentesque</a></li>
								<li><a href="#">Suspendisse iaculis mauris</a></li>
								<li><a href="#">Urnanet non molestie semper</a></li>
								<li><a href="#">Proin gravida orci porttitor</a></li>
							</ul>
						</li>
					</ul>
				</div>
				<!-- end #sidebar -->
				<div style="clear: both;">&nbsp;</div>
			</div>
		</div>
	</div>
	<!-- end #page -->
</div>
